package com.hzhq.contract.repo;

import com.hzhq.contract.bean.entity.ContractType;
import org.bson.types.ObjectId;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.mongodb.repository.MongoRepository;

import java.util.List;
import java.util.Optional;

/**
 * @author: hzhq1255
 * @mail: hzhq1255@163.com
 * @date: 2021/4/13 14:49
 * @desc:
 */
public interface ContractTypeRepository extends MongoRepository<ContractType, ObjectId> {

    Optional<ContractType> findByTypeNameAndDeleted(String name,Integer deleted);

    Optional<ContractType> findByTypeIdAndDeleted(ObjectId id,Integer deleted);

    Optional<ContractType> findByTypeCodeAndDeleted(Integer code, Integer deleted);

    List<ContractType> findByDeleted(Integer deleted);

    Page<ContractType> findByDeleted(Integer deleted, Pageable pageable);
}
